jak vyplnit formular v IE pomoci Delphi
Otázka od: Petr Matejovsky
6. 10. 2002 14:17
Zdravim
potreboval bych z programu zavolat Internet Explorer a do stranky vlozit
nejake udaje. Poradite jak na to v Delphi.
Kousek kodu v VB
dim oie
oie = createobject ("InternetExplorer.Application")
oie.visible = true
oie.navigate = "localhost"
oie.document.all(2).value = "test"
....
oie.quit
oie = null
D5 prof, W2000
predem diky
Petr Matejovsky
Odpovedá: Petr Vones
7. 10. 2002 23:18
From: "Petr Matejovsky" <pemasoft@seznam.cz>
> potreboval bych z programu zavolat Internet Explorer a do stranky vlozit
> nejake udaje. Poradite jak na to v Delphi.
>
> Kousek kodu v VB
>
> dim oie
> oie = createobject ("InternetExplorer.Application")
> oie.visible = true
> oie.navigate = "localhost"
> oie.document.all(2).value = "test"
> ....
Priblizne takto:
uses
SHDocVw, MsHtml;
procedure TForm1.Button1Click(Sender: TObject);
var
IE: InternetExplorer;
begin
IE := CoInternetExplorer.Create;
IE.Visible := True;
IE.Navigate('localhost', EmptyParam, EmptyParam, EmptyParam, EmptyParam);
((IE.Document as IHTMLDocument2).all.item(2, EmptyParam) as
IHTMLInputElement).value := 'test';
end;
Petr Vones